const Router = require('koa-router'),
	mongoose = require('mongoose')

let router = new Router()

router.get('/getCateList', async ctx => {
	try {
		const Category = mongoose.model('Category'),
			result = await Category.find().exec()

		ctx.body = {
			code: 200,
			message: result
		}
	} catch (error) {
		ctx.body = {
			code: 500,
			message: error
		}
	}
})

module.exports = router
